package com.ruoyi.controller;

import com.ruoyi.common.Result;
import com.ruoyi.service.CustomerServiceService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;

/**
 * @author 26352
 */
@RestController
@RequestMapping("/customer")
public class CustomerServiceController {

    @Resource
    CustomerServiceService customerServiceService;


    //客服登录
    @RequestMapping("/customerLogin")
    public Result customerLogin(@RequestBody ReceptionCustomerService receptionCustomerService) throws UnsupportedEncodingException {
       return customerServiceService.customerLogin(receptionCustomerService);
    }

    //查询用户
    @RequestMapping("/customerOne")
    public Result customerOne(HttpServletRequest request){
        return customerServiceService.customerOne(request);
    }

    //修改客服名称\
    @RequestMapping("/updateName")
    public Result updateName(@RequestParam("id")Integer id,@RequestParam("name")String name){
        return customerServiceService.updateName(id,name);
    }
    //修改客服服务人数
    @RequestMapping("/updateNumber")
    public Result updateNumber(@RequestParam("id")Integer id,@RequestParam("receptNum")Integer num){
        return customerServiceService.updateNumber(id,num);
    }

}
